<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>天空电影设置</title>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css?v=1024">
    <link rel="stylesheet" href="__STATIC__/css/admin_style.css?v=1024">
    <script type="text/javascript" src="__STATIC__/js/jquery.js?v=1024"></script>
    <script type="text/javascript" src="__STATIC__/layui/layui.js?v=1024"></script>
    <script>
        
    </script>
    <style type="text/css">
        label.layui-form-label {
            width: calc(100% - 40px);
            margin: 10px;
            padding: 0 10px;
            text-align: left;
        }
        .layui-input-block {
            margin-left: 0px !important;
            min-height: 36px;
            margin-right: 10px;
        }
        .layui-form-item {
            margin-bottom: 10px;
            width: 100%;
        }
        .layui-form {
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;    
            flex-wrap: wrap;
        }
        .sousuo {
            display: flex;
            padding: 0;
            margin: 0;
        }
        .layui-form-select {
            width: calc(100% - 10px - 80px);
            margin-right: 10px;
        }
        .sousuobtn {
            width: 80px;
        }
        .layui-btn {
            padding: 0 8px;
            margin: 0 !important;
        }
    </style>
</head>
<body>
    
<form  class="layui-form layui-form-pane" action="">
  <div class="layui-form-item">
    <a class="layui-btn layui-btn-primary" href="{:url('index')}" data-title="{$vo.vod_name}" title="编辑">设置链接</a>
    <a class="layui-btn layui-btn-primary" href="{:url('list')}" data-title="{$vo.vod_name}" title="编辑">列表查看</a>
    <!--<a class="layui-btn layui-btn-primary" href="/app.php/tiantang/dealTiantangByOtherSetting" -->
    <!--title="编辑">全部更新</a>-->
    <a class="layui-btn layui-btn-primary" href="/app.php/tiankong/vodindex" 
    title="访问记录">访问记录</a>

      <a class="layui-btn layui-btn-primary" href="/app.php/tiankong/matchvodindex"
         title="访问记录">访问匹配</a>
  </div>
     <div class="layui-form-item">
        <div class="layui-input-block sousuo">
            <select name="vod_id" class="sousuoinput" lay-verify="required" lay-search="">
              <option value="">选择剧集</option>
              {volist name="infodata" id="vo"}
              <option value="{$vo.vod_id}" {if condition="($vod_id == $vo['vod_id'])"} selected="selected" {/if}>{$vo.vod_name}</option>
              {/volist}
            </select>
            <button class="layui-btn sousuobtn" lay-submit="">搜索</button>
        </div>
      </div>

  <div class="layui-form-item">
      <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
            <th width="30">ID</th>
            <th width="">名称</th>
            <th width="40">key</th>
            <th {if condition="empty($vod_id)"}width="100"{else/}width="30"{/if}>操作</th>
        </tr>
        </thead>
    
        {volist name="listdata" id="vo"}
        <tr>
            <td>{$vo.vod_id}</td>
            <td class="tiantang_name tiantang_name_{$vo.vod_id}" data-id="{$vo.vod_id}">{$vo.vod_name}</td>
            <td>{$vo.key}</td>
            <td>
                {if condition="empty($vod_id)"}
                <a class="j-iframe layui-btn" data-href="{:url('/tiantang/fixedkongurl/vodId/'.$vo['vod_id'])}" data-height="450px" data-title="{$vo.vod_name}-{$vo.key}-数据更新" href="javascript:;" title="更新">更新</a>
                {/if}
                <a class="j-iframe layui-btn layui-btn-primary" data-href="{:url('listinfo?id='.$vo['id'])}" data-height="450px" data-title="{$vo.vod_name}-{$vo.key}" href="javascript:;" title="编辑">编辑</a>
                <a class="layui-btn layui-btn-primary deletelist" data-href="{:url('listdel?id='.$vo['id'])}" data-height="450px" data-title="{$vo.vod_name}-{$vo.key}" href="javascript:;" title="删除">删除</a>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    {if condition="!empty($vod_id)"}
      {if !$isFindRecommend}
      <a class="j-ajax  layui-btn" data-refresh="false" data-href="{:url('/tiankong/addTuijian/vodId/'.$vo['vod_id'])}" href="javascript:;" title="插入到小编推荐" data-confirm="">插入到小编推荐</a>
      {/if}
      <a class="j-ajax  layui-btn" data-refresh="false" data-href="{:url('/tiankong/lianzaiupdate/vodId/'.$vo['vod_id'])}" href="javascript:;" title="修改" data-confirm="">修改 <font  style="color:#fff;font-size: 12px;">[当前：{$datavo.is_lianzai == 1?'连载':'不连载'}]</font></a>
      <a class="j-iframe layui-btn" style="float: right;" data-href="{:url('/tiantang/fixedkongurl/vodId/'.$vo['vod_id'])}" data-height="450px" data-title="{$vo.vod_name}-{$vo.key}-数据更新" href="javascript:;"
    title="更新本剧">更新本剧</a>
    {/if}
  </div>
</form>
{include file="../../../application/admin/view/public/foot" /}
<script src="https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.6/clipboard.min.js"></script>
<script>
  layui.use(['form', 'layedit', 'laydate'], function(){
      var form = layui.form
      ,layer = layui.layer;
        $(".deletelist").click(function() {
            var url = $(this).attr("data-href");
            layer.confirm('您确认要删除吗？', {
              btn: ['是的','否'] //按钮
            }, function(){
              $.get(url,function(res) {
                  if(res.code == 1) {
                  }
                  layer.closeAll();
                  location.reload();
              },"json")
            }, function(){
              
            });
        });
        $(".tiantang_name").each(function(item, index) {
            var id = $(this).attr("data-id");
            var clipboard = new ClipboardJS(".tiantang_name_" + id, {
                text: function () {
                    var name = $($(".tiantang_name_" + id)[0]).text();
                    return name;
                }
            });
        
            clipboard.on('success', function (e) {
                layer.msg('复制成功');
            });
        
            clipboard.on('error', function (e) {
                
            });
        })
  });
  
</script>
</body>
</html>